package main

import (
	"time"
	"fmt"
)

var ch chan bool

func t1() {
	select {
	case <-ch:
		fmt.Printf("ch recv\n")
	case <-time.After(time.Second * 10):
		fmt.Printf("timer expire\n")
	}
}

func tSelect() {
	ch = make(chan bool)
	go func ()  {
		time.Sleep(2 * time.Second)
		fmt.Printf("setting ch true\n")
		//ch <- true
		close(ch)
	}()

	t1()
}